package com.hsgene.shoppingcar.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.coupon.dto.GeneticDiscountDto;
import com.hsgene.shoppingcar.service.api.impl.DiscountCouponServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @author maodi
 * @description 优惠券Controller
 * @createDate 2018/10/23 16:10
 * @return
 */
@FeignClient(name = "ms-mod-discount", path = "/v1.0/genetic/testing/discounts", fallback = DiscountCouponServiceImpl.class)
public interface DiscountCouponService {

    /**
     * @param platform 平台id
     * @param userId   用户id
     * @param orderBy  排序
     * @param isAsc    升降序
     * @param page     页数
     * @param size     每页数量
     * @return com.hsgene.common.util.result.ApiResult<java.util.List<com.hsgene.coupon.dto.GeneticDiscountDto>>
     * @description 查询当前有效的优惠券列表
     * @author maodi
     * @createDate 2018/10/25 18:12
     */
    @GetMapping
    ApiResult<List<GeneticDiscountDto>> queryEffectiveDiscount(
            @RequestParam(name = "platform", defaultValue = "1") Integer platform,
            @RequestParam(name = "userId", required = false) String userId,
            @RequestParam(name = "orderBy", required = false) String orderBy,
            @RequestParam(name = "isAsc", defaultValue = "false") Boolean isAsc,
            @RequestParam(name = "page", defaultValue = "1") int page,
            @RequestParam(name = "size", defaultValue = "10") int size);
}
